package acwing.周赛;/**
 * @author： li
 * @date： 2022-03-13 14:12
 * @version 1.0
 */
import java.io.*;
import java.util.Scanner;
public class 出现次数1 {
    static BufferedReader BR = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
    public static void main(String[] args) throws IOException {
//        Scanner sc =new Scanner(new BufferedInputStream(System.in));
        String [] line = BR.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int m = Integer.parseInt(line[1]);
        int q = Integer.parseInt(line[2]);

        String s = BR.readLine();
        String t = BR.readLine();
//        String s,t;
//        int n,m,q;
//        n=sc.nextInt();
//        m=sc.nextInt();
//        q=sc.nextInt();
//        s = sc.next();
//        t = sc.next();
        int from,to;
        while((q--)>0){
            line = BR.readLine().split(" ");
            from = Integer.parseInt(line[0]);
            to = Integer.parseInt(line[1]);
//            from=sc.nextInt();
//            to=sc.nextInt();
            String zichuan = s.substring(from-1,to);
            int count=0;
            for(int i=0;i<=zichuan.length()-m;i++){
                if(zichuan.startsWith(t,i))
                    count++;
            }
//            System.out.println(count);
            out.write(count+"\n");
        }
        BR.close();
//        sc.close();
        out.flush();
    }
}